package ddz

import (
	"gamesdk/inter"
	"gamesdk/wanyu/server/api/gameapi/gameframe"
	"gamesdk/wanyu/server/api/gameapi/games/ddz/game"
	"gamesdk/wanyu/server/api/gameapi/games/ddz/robot"
	"gamesdk/wanyu/server/protogo/gameddz"
	"github.com/magicsea/behavior3go/core"
	b3core "github.com/magicsea/behavior3go/core"
)

type Factory struct{
}
func (fact *Factory) InitTableFrameSink(table inter.TableInter) {
	ddz:=  game.CreateGame(r)
	table.BindGame(&game.DdzGame{Table:table} )
}
func (fact *Factory) UserExit(user inter.UserInetr) {

}

//创建游戏工厂
func Init() inter.RoomInter {
	return new(Factory)
}

//创建游戏配置
func (fact *Factory) CreateExCfgBuf() (interface{}, interface{}) {
	return &gameddz.GameExCfg{}, &gameddz.KindExCfg{}
}

////创建游戏实例
//func (fact *Factory) CreateGame(r inter.RoomInter) inter.GameInter {
//	return game.CreateGame(r)
//}

//初始化行为树
func (fact *Factory) CreateBehaviorTree() *core.BehaviorTree {
	return robot.CreateBehaviorTree()
}

//创建机器人
func (fact *Factory) CreateRobot(mgr inter.RobotInter, player inter.UserInetr, tree *b3core.BehaviorTree, rCfg *wanju_gameframe.RobotCfg) wanju_gameframe.Robot {
	return robot.CreateRobot(mgr, player, tree, rCfg)
}
